import request from '@/utils/request'

// 查询充电桩列表
export function listChargers(query) {
  return request({
    url: '/charger/chargers/list',
    method: 'get',
    params: query
  })
}

// 查询充电桩详细
export function getChargers(id) {
  return request({
    url: '/charger/chargers/' + id,
    method: 'get'
  })
}

// 新增充电桩
export function addChargers(data) {
  return request({
    url: '/charger/chargers',
    method: 'post',
    data: data
  })
}

// 修改充电桩
export function updateChargers(data) {
  return request({
    url: '/charger/chargers',
    method: 'put',
    data: data
  })
}

// 删除充电桩
export function delChargers(id) {
  return request({
    url: '/charger/chargers/' + id,
    method: 'delete'
  })
}

// 查询所有空闲状态的充电桩
export function getFreeChargers() {
  return request({
    url: '/charger/chargers/all',
    method: 'get'
  })
}
